package org.example.cardgame.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.example.cardgame.controller.PageWebSocket;
import org.example.cardgame.entity.Message;

/**
 * @Author juanita.ren
 * @Date 2024/11/11 22:08
 * @Version 1.0
 */
public class PageHandle {
    public PageHandle() {
    }

    public static void sendMessage(Message message) {
        PageWebSocket.sendMessageToWeb(JSON.toJSONString(message, new SerializerFeature[]{SerializerFeature.DisableCircularReferenceDetect}));
    }
}
